<include file="Common/topBanner" />
{//导航}
<div class="row">
    <include file="Common/Nav" />
</div>
<div class="panel panel-color panel-blue">
    <div class="panel-heading">
        我的提问
    </div>

    <form method="post" action="__URL__/NewTopic" class="form-horizontal">
    <div class="panel-body">
        <div class="form-group">
            <label for="Title" class="col-sm-2 control-label">您的提问：</label>
            <div class="col-sm-7">
                <input type="text" id="Title" name="Title" class="form-control" placeholder="提问标题">
                还可以输入<span id="TitleLen" class="TitleLen">0</span>个字符
            </div>
            <div class="col-sm-3">

            </div>
        </div>

        <div class="form-group">
            <label for="Content" class="col-sm-2 control-label">补充说明：</label>
            <div class="col-sm-7">
                <textarea id="Content" name="Content" class="form-control" rows="8" cols="118" placeholder="请输入对问题的补充说明"></textarea>
                还可以输入<span id="ContentLen" class="TitleLen">0</span>个字符
            </div>
            <div class="col-sm-3">

            </div>
        </div>

        <div class="form-group">
            <label for="Keywords" class="col-sm-2 control-label">关键词：</label>
            <div class="col-sm-7">
                <input type="text" id="Keywords" name="Keywords" class="form-control" placeholder="关键字">
            </div>
            <div class="col-sm-3">

            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="hidden" id="BoardId" name="BoardId" value="{$bid}">
                <input type="submit" value=" 提交问题 " class="btn btn-info" />
            </div>
        </div>
    </div>
    </form>
</div>

<script language="javascript">
    $(document).ready(function () {
        calculateTypeCnt();
    });

    function calculateTypeCnt() {
        var MaxTitleLength = 50;
        var MaxConLength = 500;

        if ($("#Title").val() != undefined) {
            $("#ContentLen").html(MaxConLength - $("#Content").val().length);
            $("#TitleLen").html(MaxTitleLength - $("#Title").val().length);

            $("#Title").keyup(function () {
                var ContLen = $("#Title").val().length;
                var NowLen = MaxTitleLength - ContLen;
                $("#TitleLen").html(NowLen.toString());
                if (NowLen <= 0) {
                    $("#Title").val($("#Title").val().substring(0, MaxTitleLength));
                    $("#TitleLen").html("0");
                }
            });

            $("#Content").keyup(function () {
                var ContLen = $("#Content").val().length;
                var NowLen = MaxConLength - ContLen;
                $("#ContentLen").html(NowLen.toString());
                if (NowLen <= 0) {
                    $("#Content").val($("#Content").val().substring(0, MaxConLength));
                    $("#ContentLen").html("0");
                }
            });
        }
    }

</script>